//给定s1 s2 , s1不断地循环移动,s2是否能任意完全匹配s1的结果中的一个?
//如s1 = ABC 循环移动的结果: ABC CAB BCA ABC
function charInclude(s1, s2) {
  let  a = 0
  let len = s1.length
  while (1) {
    a++
    let end = s1.charAt(len - 1)
    let template = s1.substring(0, len - 1)
    s1 = end + template
    console.log(s1)
    if (s1.includes(s2)) return true
    if (a === len) return false
  }
}

console.log(charInclude('ABCDEFGH', 'EDC'))
